package com.jianyun.jyzs.bean;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

import java.io.Serializable;

/**
 * Created by mlli on 2017/9/20.
 */

@DatabaseTable
public class QualityRespon extends Response implements Serializable{

    @Override
    public String toString() {
        return "QualityRespon{" +
                "deleted=" + deleted +
                ", fromWeb=" + fromWeb +
                ", message='" + message + '\'' +
                ", po=" + po +
                ", qualityInspects='" + qualityInspects + '\'' +
                ", result=" + result +
                '}';
    }

    /**
     * deleted : false
     * fromWeb : false
     * message : null
     * po : {"attachmentVersion":1,"createDate":null,"createUserId":null,"createUserName":null,"emergencyState":null,"endDate":null,"enterpriseCode":null,"folderName":"5be9ae9c-58b7-464f-bb4c-4a5e3a11ffef","id":"82","importantState":null,"inspectDate":null,"location":null,"nodeVersion":1,"projectId":null,"projectName":null,"realEndDate":null,"rectificationDate":null,"responUser":null,"responUserId":null,"titleName":null,"version":1,"workState":null,"workType":null,"worknote":null}
     * qualityInspects : null
     * result : true
     */

    private boolean deleted;
    private boolean fromWeb;
    private String message;
    private QualityRes po;
    private String qualityInspects;
    private boolean result;

    public boolean isDeleted() {
        return deleted;
    }

    public void setDeleted(boolean deleted) {
        this.deleted = deleted;
    }

    public boolean isFromWeb() {
        return fromWeb;
    }

    public void setFromWeb(boolean fromWeb) {
        this.fromWeb = fromWeb;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public QualityRes getPo() {
        return po;
    }

    public void setPo(QualityRes po) {
        this.po = po;
    }

    public String getQualityInspects() {
        return qualityInspects;
    }

    public void setQualityInspects(String qualityInspects) {
        this.qualityInspects = qualityInspects;
    }

    public boolean isResult() {
        return result;
    }

    public void setResult(boolean result) {
        this.result = result;
    }

    @DatabaseTable(tableName = "tb_quality")
    public static class QualityRes implements Serializable {



        @DatabaseField
        private int attachmentVersion;
        @DatabaseField
        private String createDate;
        @DatabaseField
        private String createUserId;
        @DatabaseField
        private String createUserName;
        @DatabaseField
        private String emergencyState;
        @DatabaseField
        private String endDate;
        @DatabaseField
        private String enterpriseCode;
        @DatabaseField
        private String folderName;
        @DatabaseField(id = true)
        private String id;
        @DatabaseField
        private String importantState;
        @DatabaseField
        private String inspectDate;
        @DatabaseField
        private String location;
        @DatabaseField
        private int nodeVersion;
        @DatabaseField
        private String projectId;
        @DatabaseField
        private String projectName;
        @DatabaseField
        private String realEndDate;
        @DatabaseField
        private String rectificationDate;
        @DatabaseField
        private String responUser;
        @DatabaseField
        private String responUserId;
        @DatabaseField
        private String titleName;
        @DatabaseField
        private int version;
        @DatabaseField
        private String workState;
        @DatabaseField
        private String workType;
        @DatabaseField
        private String worknote;
        @DatabaseField
        private String chatid;
        @DatabaseField
        private boolean unRead;
        private boolean checked;

        public boolean isChecked() {
            return checked;
        }

        public void setChecked(boolean checked) {
            this.checked = checked;
        }

        public boolean isUnRead() {
            return unRead;
        }

        public void setUnRead(boolean unRead) {
            this.unRead = unRead;
        }

        @DatabaseField
        private int wotype;//工单类型 0 默认 1 创建的 2 主责的 3 相关的
        @DatabaseField
        private String localUserId;//相关工单没有区分用户 设置相关人ID

        public int getWotype() {
            //根据userID重新判断type
            return WOTools.getType(createUserId,responUserId);
        }

        public void setWotype(int wotype) {
            this.wotype = wotype;
        }

        public String getLocalUserId() {
            return localUserId;
        }

        public void setLocalUserId(String localUserId) {
            this.localUserId = localUserId;
        }

        public String getChatid() {
            return chatid;
        }

        public void setChatid(String chatid) {
            this.chatid = chatid;
        }

        public int getAttachmentVersion() {
            return attachmentVersion;
        }

        public void setAttachmentVersion(int attachmentVersion) {
            this.attachmentVersion = attachmentVersion;
        }

        public String getCreateDate() {
            return createDate;
        }

        public void setCreateDate(String createDate) {
            this.createDate = createDate;
        }

        public String getCreateUserId() {
            return createUserId;
        }

        public void setCreateUserId(String createUserId) {
            this.createUserId = createUserId;
        }

        public String getCreateUserName() {
            return createUserName;
        }

        public void setCreateUserName(String createUserName) {
            this.createUserName = createUserName;
        }

        public String getEmergencyState() {
            return emergencyState;
        }

        public void setEmergencyState(String emergencyState) {
            this.emergencyState = emergencyState;
        }

        public String getEndDate() {
            return endDate;
        }

        public void setEndDate(String endDate) {
            this.endDate = endDate;
        }

        public String getEnterpriseCode() {
            return enterpriseCode;
        }

        public void setEnterpriseCode(String enterpriseCode) {
            this.enterpriseCode = enterpriseCode;
        }

        public String getFolderName() {
            return folderName;
        }

        public void setFolderName(String folderName) {
            this.folderName = folderName;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getImportantState() {
            return importantState;
        }

        public void setImportantState(String importantState) {
            this.importantState = importantState;
        }

        public String getInspectDate() {
            return inspectDate;
        }

        public void setInspectDate(String inspectDate) {
            this.inspectDate = inspectDate;
        }

        public String getLocation() {
            return location;
        }

        public void setLocation(String location) {
            this.location = location;
        }

        public int getNodeVersion() {
            return nodeVersion;
        }

        public void setNodeVersion(int nodeVersion) {
            this.nodeVersion = nodeVersion;
        }

        public String getProjectId() {
            return projectId;
        }

        public void setProjectId(String projectId) {
            this.projectId = projectId;
        }

        public String getProjectName() {
            return projectName;
        }

        public void setProjectName(String projectName) {
            this.projectName = projectName;
        }

        public String getRealEndDate() {
            return realEndDate;
        }

        public void setRealEndDate(String realEndDate) {
            this.realEndDate = realEndDate;
        }

        public String getRectificationDate() {
            return rectificationDate;
        }

        public void setRectificationDate(String rectificationDate) {
            this.rectificationDate = rectificationDate;
        }

        public String getResponUser() {
            return responUser;
        }

        public void setResponUser(String responUser) {
            this.responUser = responUser;
        }

        public String getResponUserId() {
            return responUserId;
        }

        public void setResponUserId(String responUserId) {
            this.responUserId = responUserId;
        }

        public String getTitleName() {
            return titleName;
        }

        public void setTitleName(String titleName) {
            this.titleName = titleName;
        }

        public int getVersion() {
            return version;
        }

        public void setVersion(int version) {
            this.version = version;
        }

        public String getWorkState() {
            return workState;
        }

        public void setWorkState(String workState) {
            this.workState = workState;
        }

        public String getWorkType() {
            return workType;
        }

        public void setWorkType(String workType) {
            this.workType = workType;
        }

        public String getWorknote() {
            return worknote;
        }

        public void setWorknote(String worknote) {
            this.worknote = worknote;
        }

        @Override
        public String toString() {
            return "CrmDetailBean{" +
                    "attachmentVersion=" + attachmentVersion +
                    ", createDate='" + createDate + '\'' +
                    ", createUserId='" + createUserId + '\'' +
                    ", createUserName='" + createUserName + '\'' +
                    ", emergencyState='" + emergencyState + '\'' +
                    ", endDate='" + endDate + '\'' +
                    ", enterpriseCode='" + enterpriseCode + '\'' +
                    ", folderName='" + folderName + '\'' +
                    ", id='" + id + '\'' +
                    ", importantState='" + importantState + '\'' +
                    ", inspectDate='" + inspectDate + '\'' +
                    ", location='" + location + '\'' +
                    ", nodeVersion=" + nodeVersion +
                    ", projectId='" + projectId + '\'' +
                    ", projectName='" + projectName + '\'' +
                    ", realEndDate='" + realEndDate + '\'' +
                    ", rectificationDate='" + rectificationDate + '\'' +
                    ", responUser='" + responUser + '\'' +
                    ", responUserId='" + responUserId + '\'' +
                    ", titleName='" + titleName + '\'' +
                    ", version=" + version +
                    ", workState='" + workState + '\'' +
                    ", workType='" + workType + '\'' +
                    ", worknote='" + worknote + '\'' +
                    '}';
        }
    }
}
